package com.stusy.blog.everythingcanblog.service.impl;

import com.stusy.blog.everythingbloginterface.bean.UserInfo;
import com.stusy.blog.everythingbloginterface.service.UserInfoService;
import com.stusy.blog.everythingcanblog.bean.UserInfoPo;
import com.stusy.blog.everythingcanblog.dao.UserInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author Xinpei Li
 * @create 2022-02-17 20:50
 */

@DubboService
@Slf4j
public class UserInfoServiceImpl implements UserInfoService {

    @Resource
    private UserInfoMapper userInfoMapper;

    @Override
    public UserInfo getUserInfo(String userName) {
        log.info("[UserInfoService] getUseInfo userName={}",userName);
        UserInfoPo name = userInfoMapper.getByUserName(userName);
        UserInfo userInfo = new UserInfo();
        BeanUtils.copyProperties(name,userInfo);
        return userInfo;
    }
}
